<template>
    <div class="im-ti-topTable">
        <el-table
        ref="receiveTable"
        size="mini"
        :data="resData"
        style="width: 100%"
        height="190"
        >
        <el-table-column type="index" label="序号" width="50" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="rowNo" label="巷道" width="70" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="shelvesCode" label="货位编码" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="status" label="货位状态 " :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="palletCode" label="操作盘" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="isEmpty" label="是否为空箱" :show-overflow-tooltip="true"> </el-table-column>
      </el-table>
        <!-- 分页 -->
        <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageNumber"
        :page-sizes="[10,20,50,100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalCount">
        </el-pagination>
    </div>
</template>
<script>
// import { trayInfoSearch } from "@/utils/api.js";
export default {
    name:"ImTiTopTable",
    data(){
        return{
             // 当前页数
            pageNumber: 1,
            // 数据总个数
            totalCount: 0,
            // 返回的数据数组
            resData: [],
            // 每页数据个数
            pageSize: 100,
            // 确认列表高亮参数
            stableIndex: 0,
        }
    },
    methods:{
        // 每页个数改变
        handleSizeChange(val){
            this.pageSize = val
            this.$bus.$emit('imTiPageSize',this.pageSize)
        },
        // 页数改变 
        handleCurrentChange(val) {
            this.pageNumber = val;
            this.$bus.$emit('imTiPageNumber',this.pageNumber)
        },
    },
    mounted() {
        // 接收TopInput查询到的数据
        this.$bus.$on('ImTiSearchData',(e)=>{
            this.resData = e.result
            this.totalCount = e.pageParameter.totalCount
        })
  }
}
</script>
<style scoped>
.im-ti-topTable {
    text-align: center;
}
</style>